home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group00b.txt
/
000098_icon-group-sender_Tue Oct 24 13:26:56 2000.msg
< prev
next >
Wrap
Internet Message Format
|
2001-01-03
|
3KB
Return-Path: <icon-group-sender>
Received: (from root@localhost)
by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9OKQmx24336
for icon-group-addresses; Tue, 24 Oct 2000 13:26:48 -0700 (MST)
Message-Id: <200010242026.e9OKQmx24336@baskerville.CS.Arizona.EDU>
From: symbiot@my-deja.com
X-Newsgroups: comp.lang.icon
Subject: Re: How to "declare" a string?
Date: Tue, 24 Oct 2000 18:03:48 GMT
To: trollet@skynet.be
X-Article-Creation-Date: Tue Oct 24 18:03:48 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)
X-Http-Proxy: 1.0 SRVPROXY, 1.0 x61.deja.com:80 (Squid/1.1.22) for client 208.51.185.226
X-MyDeja-Info: XMYDJUIDsymbiot
To: icon-group@cs.arizona.edu
Errors-To: icon-group-errors@cs.arizona.edu
Status: RO
Content-Length: 1711
Hi,
Thanks for your response.
I based my program on the same assumption you made concerning how ICON
scan variables and assigns type according to usage (and even converts
on the fly).
But in the statement I listed, it seemed to barf because I was
requiring it to create an indexed string.
The line was, essentially,
data[index] := .....results of some string operation....
I even tried intially data with
data := " "
But that created a variable that was one cell in size. So when the
abouve statement got to "index := 2", it barfed because the variable
data wasn't large enough.
So again I'm back to the quesiton, "How to 'declare' a string variable?"
In article <39F43189.BBF358BC@skynet.be>,
Atle <trollet@skynet.be> wrote:
> symbiot@my-deja.com wrote:
> >
>
> > best I can tell, it is choking because UPPER has not
been "declared".
> I am a *total* newbie, but I may have an answer to this one
> (Icon programmer please correct this if wrong)
> Icon will extract as much information from your statements as
possible.
>
> so, if you initialize a variable like this:
>
> i := 0
>
> it will not need an
>
> i : INTEGER to figure it out, it knows that 0 is an integer, and will
declare i implicitely.
>
> the same with a string:
>
> s := ""
>
> will implicitely declare s to be string type.
>
> If in the start of your program, you set
>
> UPPER := ""
>
> you might solve an 'undeclared' reference ...
>
> PS!
> Please have this checked. It is just a suggestion.
> ENDPS!
>
> --
> Best wishes, Atle
>
> users.skynet.be/atle
>
--
"Wife who put husband in doghouse, soon find him in cathouse."
-- Wisdom of the Tao
Sent via Deja.com http://www.deja.com/
Before you buy.